package cn.outsourcing.supermarket.controller;

import cn.outsourcing.supermarket.common.Result;
import cn.outsourcing.supermarket.dto.WxLoginMsgDTO;
import cn.outsourcing.supermarket.common.utils.ResultUtils;
import cn.outsourcing.supermarket.service.HiolabsUserService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 前端控制器
 *
 * @author gzkemays
 * @since 2021-10-20
 */
@RestController
@RequestMapping("/auth")
public class HiolabsUserController {
  @Resource HiolabsUserService userService;

  @PostMapping("/loginByWeixin")
  public Result loginByWeiXin(@RequestBody WxLoginMsgDTO info) {
    return ResultUtils.simpleResult(userService.login(info));
  }
}
